package com.bizmerce.rnd.oms.judgment.web;

import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import com.bizmerce.rnd.oms.codemng.web.CodeMngController;
import com.bizmerce.rnd.oms.judgment.service.JuSearchVO;
import com.bizmerce.rnd.oms.judgment.service.JudgmentService;
import com.bizmerce.rnd.oms.judgment.service.JudgmentVO;

import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;

@Controller
public class JudgmentController {
	
	Log log = LogFactory.getLog(CodeMngController.class);
	
	@Resource(name = "judgmentService")
	JudgmentService judgmentService;

	/**
	 * 판정이력정보
	 * @ 
	 */
	@RequestMapping("/judgment/judg_select.do")
	public String selectJudgment(@ModelAttribute JuSearchVO searchVO, Model model)  {
		PaginationInfo paginationInfo = new PaginationInfo();
		paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
		paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
		paginationInfo.setPageSize(searchVO.getPageSize());
		paginationInfo.setTotalRecordCount(judgmentService.selectJudgmentCount(searchVO));
	
		List<JudgmentVO> result = judgmentService.selectJudgment(searchVO);
		model.addAttribute("judg", result);
		model.addAttribute("paginationInfo", paginationInfo);
		return "codemng/oms30";
	}
	
	/**
     * 판정이력정보-확인서출력
     */
    @RequestMapping("/judgment/form13.do")
    public String form13(@ModelAttribute JuSearchVO searchVO, Model model)  {    
        return "forward:/reporting/form13.do";
    }
}